package com.magnificent.atlantis.client.data.message.messages;

import com.magnificent.atlantis.client.data.configuration.ServerConfiguration;
import com.magnificent.atlantis.common.entity.messages.ServerChangeMeetingTimeMessage;
import com.magnificent.atlantis.common.entity.messages.ServerMessage;

import javax.xml.bind.annotation.XmlAttribute;
import java.util.Date;

/**
 * User: Babanin
 * Date: Sep 27, 2009
 * Time: 1:12:54 PM
 */
public class ClientChangeMeetingTimeMessage extends ClientMeetingMessage {
    private Date newMeetingTime;

    public ClientChangeMeetingTimeMessage() {
    }

    public ClientChangeMeetingTimeMessage(ServerChangeMeetingTimeMessage serverMeetingMessage, ServerConfiguration configuration) {
        super(serverMeetingMessage, configuration);
    }

    public String getTitle() {
        return "Change meeting time";
    }

    @XmlAttribute()
    public Date getNewMeetingTime() {
        return newMeetingTime;
    }

    public void setNewMeetingTime(Date newMeetingTime) {
        this.newMeetingTime = newMeetingTime;
    }

    public ServerMessage toServerMessage() {
        ServerChangeMeetingTimeMessage message = new ServerChangeMeetingTimeMessage();
        super.copyDataTo(message);
        message.setNewMeetingTime(newMeetingTime);

        return message;
    }
}
